<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Returns an object with properties that describe the DB2 database client</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="function.db2-bind-param.html">« db2_bind_param</a></li>
      <li style="float: right;"><a href="function.db2-close.html">db2_close »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="ref.ibm-db2.html">IBM DB2 函数</a></li>
    <li>Returns an object with properties that describe the DB2 database client</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="function.db2-client-info" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">db2_client_info</h1>
  <p class="verinfo">(PECL ibm_db2 &gt;= 1.1.1)</p><p class="refpurpose"><span class="refname">db2_client_info</span> &mdash; <span class="dc-title">Returns an object with properties that describe the DB2 database client</span></p>

 </div>
 <div class="refsect1 description" id="refsect1-function.db2-client-info-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>db2_client_info</strong></span>(<span class="methodparam"><span class="type">resource</span> <code class="parameter">$connection</code></span>): <span class="type">object</span></div>


  <p class="para rdfs-comment">
   This function returns an object with read-only properties that return
   information about the DB2 database client. The following table lists
   the DB2 client properties:
   <table class="doctable table">
    <caption><strong>DB2 client properties</strong></caption>
    
     <thead>
      <tr>
       <th>Property name</th>
       <th>Return type</th>
       <th>Description</th>
      </tr>

     </thead>

     <tbody class="tbody">
      <tr>
       <td>APPL_CODEPAGE</td>
       <td>int</td>
       <td>The application code page.</td>
      </tr>

      <tr>
       <td>CONN_CODEPAGE</td>
       <td>int</td>
       <td>The code page for the current connection.</td>
      </tr>

      <tr>
       <td>DATA_SOURCE_NAME</td>
       <td>string</td>
       <td>The data source name (DSN) used to create the current connection
        to the database.</td>
      </tr>

      <tr>
       <td>DRIVER_NAME</td>
       <td>string</td>
       <td>The name of the library that implements the DB2 Call
        Level Interface (CLI) specification.</td>
      </tr>

      <tr>
       <td>DRIVER_ODBC_VER</td>
       <td>string</td>
       <td>The version of ODBC that the DB2 client supports. This returns a
        string &quot;MM.mm&quot; where <var class="varname">MM</var> is the major version and
        <var class="varname">mm</var> is the minor version. The DB2 client always
        returns &quot;03.51&quot;.
       </td>
      </tr>

      <tr>
       <td>DRIVER_VER</td>
       <td>string</td>
       <td>The version of the client, in the form of a string &quot;MM.mm.uuuu&quot; where
        <var class="varname">MM</var> is the major version, 
        <var class="varname">mm</var> is the minor version,
        and <var class="varname">uuuu</var> is the update. For example, &quot;08.02.0001&quot;
        represents major version 8, minor version 2, update 1.
       </td>
      </tr>

      <tr>
       <td>ODBC_SQL_CONFORMANCE</td>
       <td>string</td>
       <td>
        <p class="para">The level of ODBC SQL grammar supported by the client:
        <dl>
         
          <dt>
MINIMUM</dt>

          <dd>

           <p class="para">
            Supports the minimum ODBC SQL grammar.
           </p>
          </dd>

         
         
          <dt>
CORE</dt>

          <dd>

           <p class="para">
            Supports the core ODBC SQL grammar.
           </p>
          </dd>

         
         
          <dt>
EXTENDED</dt>

          <dd>

           <p class="para">
            Supports extended ODBC SQL grammar.
           </p>
          </dd>

         
        </dl>

        </p>
       </td>
      </tr>

      <tr>
       <td>ODBC_VER</td>
       <td>string</td>
       <td>The version of ODBC that the ODBC driver manager supports. This
        returns a string &quot;MM.mm.rrrr&quot; where <var class="varname">MM</var> is the major
        version, <var class="varname">mm</var> is the minor version, and
        <var class="varname">rrrr</var> is the release. The DB2 client always returns
        &quot;03.01.0000&quot;.
       </td>
      </tr>

     </tbody>
    
   </table>

  </p>

 </div>

 <div class="refsect1 parameters" id="refsect1-function.db2-client-info-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>
    
     <dt>
<code class="parameter">connection</code></dt>

     <dd>

      <p class="para">
       Specifies an active DB2 client connection.
      </p>
     </dd>

    
   </dl>

  </p>
 </div>

 <div class="refsect1 returnvalues" id="refsect1-function.db2-client-info-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   Returns an object on a successful call. Returns <strong><code>false</code></strong> on failure.
  </p>
 </div>


 

 

 <div class="refsect1 examples" id="refsect1-function.db2-client-info-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   <div class="example" id="example-1245">
    <p><strong>示例 #1 A <span class="function"><strong>db2_client_info()</strong></span> example</strong></p>
    <div class="example-contents"><p>
     To retrieve information about the client, you must pass a valid
     database connection resource to <span class="function"><strong>db2_client_info()</strong></span>.
    </p></div>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />$conn&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">db2_connect</span><span style="color: #007700">(&nbsp;</span><span style="color: #DD0000">'SAMPLE'</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'db2inst1'</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'ibmdb2'&nbsp;</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$client&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">db2_client_info</span><span style="color: #007700">(&nbsp;</span><span style="color: #0000BB">$conn&nbsp;</span><span style="color: #007700">);<br /><br />if&nbsp;(</span><span style="color: #0000BB">$client</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"DRIVER_NAME:&nbsp;"</span><span style="color: #007700">;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(&nbsp;</span><span style="color: #0000BB">$client</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">DRIVER_NAME&nbsp;</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"DRIVER_VER:&nbsp;"</span><span style="color: #007700">;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(&nbsp;</span><span style="color: #0000BB">$client</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">DRIVER_VER&nbsp;</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"DATA_SOURCE_NAME:&nbsp;"</span><span style="color: #007700">;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(&nbsp;</span><span style="color: #0000BB">$client</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">DATA_SOURCE_NAME&nbsp;</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"DRIVER_ODBC_VER:&nbsp;"</span><span style="color: #007700">;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(&nbsp;</span><span style="color: #0000BB">$client</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">DRIVER_ODBC_VER&nbsp;</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"ODBC_VER:&nbsp;"</span><span style="color: #007700">;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(&nbsp;</span><span style="color: #0000BB">$client</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">ODBC_VER&nbsp;</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"ODBC_SQL_CONFORMANCE:&nbsp;"</span><span style="color: #007700">;&nbsp;&nbsp;</span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(&nbsp;</span><span style="color: #0000BB">$client</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">ODBC_SQL_CONFORMANCE&nbsp;</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"APPL_CODEPAGE:&nbsp;"</span><span style="color: #007700">;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(&nbsp;</span><span style="color: #0000BB">$client</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">APPL_CODEPAGE&nbsp;</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"CONN_CODEPAGE:&nbsp;"</span><span style="color: #007700">;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(&nbsp;</span><span style="color: #0000BB">$client</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">CONN_CODEPAGE&nbsp;</span><span style="color: #007700">);<br />}<br />else&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"Error&nbsp;retrieving&nbsp;client&nbsp;information.<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Perhaps&nbsp;your&nbsp;database&nbsp;connection&nbsp;was&nbsp;invalid."</span><span style="color: #007700">;<br />}<br /></span><span style="color: #0000BB">db2_close</span><span style="color: #007700">(</span><span style="color: #0000BB">$conn</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

    <div class="example-contents"><p>以上例程会输出：</p></div>
    <div class="example-contents screen">
<div class="cdata"><pre>
DRIVER_NAME: string(8) &quot;libdb2.a&quot;
DRIVER_VER: string(10) &quot;08.02.0001&quot;
DATA_SOURCE_NAME: string(6) &quot;SAMPLE&quot;
DRIVER_ODBC_VER: string(5) &quot;03.51&quot;
ODBC_VER: string(10) &quot;03.01.0000&quot;
ODBC_SQL_CONFORMANCE: string(8) &quot;EXTENDED&quot;
APPL_CODEPAGE: int(819)
CONN_CODEPAGE: int(819)
</pre></div>
    </div>
   </div>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.db2-client-info-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><span class="function"><a href="function.db2-server-info.html" class="function" rel="rdfs-seeAlso">db2_server_info()</a> - Returns an object with properties that describe the DB2 database server</span></li>
   </ul>
  </p>
 </div>



</div></div></div></body></html>